$( function() {
	$('.index_category_list>li').mouseover(function(e){
		$(this).find('ul').show();
	});
	$('.index_category_list>li').mouseout(function(e){
		$(this).find('ul').hide();
	});

	$('.slides li').hide().eq(0).show();
	$('.slide_trigger li:first-child').addClass('current');
	function getIndex() {
		return $('.slide_trigger li').index(
				$('.slide_trigger .current').get(0));
	}
	function slide() {
		var current = $('.slide_trigger .current').removeClass('current');
		if (current.next().length != 0) {
			current.next().addClass('current');
		} else {
			$('.slide_trigger li:first-child').addClass('current');
		}
		$('.slides li').hide().eq(getIndex()).show();
	}
	var timeId = setInterval(slide, 4000);
	$('.slide_trigger li').mouseover( function() {
		clearTimeout(timeId);
		$('.slide_trigger .current').removeClass('current');
		$(this).addClass('current');
		setTimeout( function() {
			if (!$(this).hasClass('current')) {
				$('.slides li').hide().eq(getIndex()).show();
			}
		}, 500);
	});
	$('.slide_trigger li').mouseout( function() {
		timeId = setInterval(slide, 4000);
	});
});